import { Form, Input, Button, Checkbox } from 'antd';


import './index.css'
import logo from '../../assets/logo.png'
const Login = () => {
    // values是一个对象  {mobile,code }
    const onFinish = values => {
        console.log('表单验证成功: ', values);

    }
    return (
        <div className='login'>
            <div className='login-wrapper'>
                <div>
                    <img className='img' src={logo} alt='' />
                </div>
                <Form
                    name="normal_login"
                    className="login-form"
                    initialValues={{ remember: true, mobile: '13456789102', code: '246810' }}
                    onFinish={onFinish}
                    size='large'
                >
                    <Form.Item
                        name="mobile"
                    // rules={[{ required: true, message: '请输入正确的手机号!' }]}
                    >
                        <Input placeholder="请输入手机号" />
                    </Form.Item>
                    <Form.Item
                        name="code"
                    // rules={[{ required: true, message: '请输入正确的验证码' }]}
                    >
                        <Input type="password" placeholder="请输入验证码" />
                    </Form.Item>
                    <Form.Item>
                        <Form.Item name="remember" valuePropName="checked" noStyle>
                            <Checkbox>Remember me</Checkbox>
                        </Form.Item>
                    </Form.Item>

                    <Form.Item>
                        <Button block type="primary" htmlType="submit" className="login-form-button">
                            登录
                        </Button>
                    </Form.Item>
                </Form>
            </div>
        </div>
    )
}

export default Login
